﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DCHealthCheck.MvcWeb.Classes.ViewModels.ErrorViewModel>" %>

<asp:Content ID="errorTitle" ContentPlaceHolderID="TitleContent" runat="server">
    DCHealthCheck :: Error
</asp:Content>
<asp:Content ID="errorContent" ContentPlaceHolderID="MainContent" runat="server">
    <div id="contents" style="margin-top: 20px">
        <div id="leftcontainer" style="width:900px;">
            <div style="float: left; width: 256px">
                <img src="../../images/stop-256x256.png" alt="Warning" />
                <div style="text-align: center">
                    <a href="#" id="ErrorLink" onclick="toggleError();">Show Error Details</a></div>
            </div>
            <div style="text-align: center; float: left; margin-top: 90px">
                <h1>
                    Sorry, an error occurred while processing your request.</h1>
                <br />
                <br />
                <span style="font-size: smaller">This information has been logged.</span>
            </div>
            <div class="table-horizontal-scroll-wrapper" style="float: left; display: none;" id="ErrorDiv">
                <fieldset style="color: Maroon;">
                    <% if ((Model != null) && (Model.PageError != null))
                       { %>
                    <legend>Error</legend>
                    <table>
                        <tr>
                            <td>
                                <label>
                                    Action:</label>
                            </td>
                            <td>
                                <%:Model.PageError.ActionName%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    Controller:</label>
                            </td>
                            <td>
                                <%:Model.PageError.ControllerName%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <label>
                                    Details:</label>
                            </td>
                            <td>
                                <%:new MvcHtmlString(Model.PageError.ExceptionDetails.Replace(Environment.NewLine, "<br />"))%>
                            </td>
                        </tr>
                    </table>
                    <% } %>
                </fieldset>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptsSection" runat="server">
    <script type="text/javascript">
        function toggleError() {
            if ($('#ErrorDiv').is(':visible')) {
                $('#ErrorLink').html("Show Error Details");
                $('#ErrorDiv').hide();
            }
            else {
                $('#ErrorLink').html("Hide Error Details");
                $('#ErrorDiv').show();
            }
        }      
    </script>
</asp:Content>
